<template>
  <div class="main">
    <img :src="playlist.coverImgUrl" class="bgImg" alt="" />
    <div class="itemTop">
      <div class="itemLeft" @click="$router.back()">
        <svg class="icon" aria-hidden="true">
          <use xlink:href="#icon-zuojiantou"></use>
        </svg>
        <span>歌单</span>
      </div>
      <div class="itemRight">
        <svg class="icon" aria-hidden="true">
          <use xlink:href="#icon-search"></use>
        </svg>
        <svg class="icon" aria-hidden="true">
          <use xlink:href="#icon-liebiao"></use>
        </svg>
      </div>
    </div>
    <div class="itemAvatar">
      <div class="imgs">
        <img :src="playlist.coverImgUrl" alt="" />
      </div>
      <div class="right">
        <div class="top">{{ playlist.name }}</div>
        <div class="center">
          <img :src="playlist.creator.backgroundUrl" alt="" />
          <span>{{ playlist.creator.nickname }}</span>
          <svg class="icon" aria-hidden="true">
            <use xlink:href="#icon-youjiantou"></use>
          </svg>
        </div>
        <div class="bottom">
          <span>{{ playlist.description }}</span>
          <svg class="icon" aria-hidden="true">
            <use xlink:href="#icon-youjiantou"></use>
          </svg>
        </div>
      </div>
    </div>
    <div class="category">
      <div class="item">
        <svg class="icon" aria-hidden="true">
          <use xlink:href="#icon-liaotian"></use>
        </svg>
        <span>{{ playlist.commentCount }}</span>
      </div>
      <div class="item">
        <svg class="icon" aria-hidden="true">
          <use xlink:href="#icon-fenxiang1"></use>
        </svg>
        <span>{{ playlist.shareCount }}</span>
      </div>
      <div class="item">
        <svg class="icon" aria-hidden="true">
          <use xlink:href="#icon-xiazai2"></use>
        </svg>
        <span>下载</span>
      </div>
      <div class="item">
        <svg class="icon" aria-hidden="true">
          <use xlink:href="#icon-duoxuanxuanze"></use>
        </svg>
        <span>多选</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    playlist: {
      type: Object,
      default() {
        return {};
      },
    },
  },
  setup(props) {
    if ((props.playlist.creator = "")) {
      props.playlist.creator = JSON.parse(
        sessionStorage.getItem().playlist
      ).creator;
    }
  },
};
</script>

<style scoped lang="less">
.main {
  position: relative;
  .bgImg {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    width: 100%;
    height: 300px;
    z-index: -1;
    filter: blur(30px);
  }
  .itemTop {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 40%;
    //   background-color: pink;
    .icon {
      width: 20px;
      height: 20px;
      fill: #fff;
      &:last-child {
        margin-left: 30px;
      }
    }
    .itemLeft,
    .itemRight {
      display: flex;
      align-items: center;
      color: #fff;
      font-size: 18px;
      span {
        margin-left: 20px;
      }
    }
  }
  .itemAvatar {
    display: flex;
    margin-top: 60px;
    .imgs {
      width: 100px;
      height: 100px;
      border-radius: 6px;
      img {
        width: 100%;
        height: 100%;
        border-radius: 6px;
      }
    }
    .icon {
      width: 14px;
      height: 14px;
      font-weight: 700;
    }
    .right {
      display: flex;
      flex: 1;
      flex-direction: column;
      justify-content: space-between;
      margin-left: 8px;
      color: #fff;
      .top {
        font-size: 14px;
      }
      .center {
        font-size: 14px;
        color: #ccc;
        display: flex;
        align-items: center;
        img {
          width: 20px;
          height: 20px;
          border-radius: 50%;
          margin-right: 4px;
        }
      }
      .bottom {
        display: flex;
        font-size: 12px;
        color: #ccc;
        span {
          width: 200px;
          overflow: hidden;
          white-space: nowrap;
          text-overflow: ellipsis;
        }
        .icon {
          width: 14px;
          height: 14px;
          font-weight: 700;
          fill: #fff;
        }
      }
    }
  }
  .category {
    display: flex;
    justify-content: space-around;
    font-size: 14px;
    margin-top: 50px;
    color: #fff;
    .icon {
      width: 28px;
      height: 28px;
      fill: #fff;
      margin-bottom: 4px;
    }
    .item {
      display: flex;
      flex-direction: column;
      align-items: center;
    }
  }
}
</style>
